home *** CD-ROM | disk | FTP | other *** search
/ Pulps on CDRom / Pulps on CDROM.iso / comm.z / Topic.js < prev    next >
Text File  |  1998-10-20  |  3KB  |  145 lines

  1. /* ==================================================================
  2.  
  3. FILE:   Topic.js
  4.  
  5. DESCR:  Topic library file for Netscape Help implementation.
  6.  
  7. NOTES:  
  8.  
  9. ================================================================== */
  10.  
  11.  
  12.  
  13. // Make system object easily available to topics. Note that
  14.  
  15. // when a topic file is printed, the browser reloads the document
  16.  
  17. // internally out of the frameset context. This means that these
  18.  
  19. // references may be undefined, so test first.
  20.  
  21. var system
  22.  
  23. if ( typeof top.SystemFrame != "undefined" ) {
  24.  
  25.    system = top.SystemFrame.systemObj
  26.  
  27. }
  28.  
  29.  
  30.  
  31. function onload()
  32.  
  33. {
  34.  
  35.    //top.SystemFrame.trace( "topic.js onload()" )
  36.  
  37.    //alert( "topic.js onload()" )
  38.  
  39.  
  40.  
  41.    // Same print issue.
  42.  
  43.    if ( typeof top.SystemFrame == "undefined" ) return
  44.  
  45.  
  46.  
  47.    // Bind events to global event handlers.
  48.  
  49.    top.bindDocEvts( document )
  50.  
  51.  
  52.  
  53.    // Verify all hrefs are nethelp: URLs.
  54.  
  55.    if ( top.SystemFrame.CHECK_HREFS ) {
  56.  
  57.       for ( i = 0; i < document.links.length; i++ ) {
  58.  
  59.  
  60.  
  61.          // Exempt certain schemes.
  62.  
  63.          var href = document.links[ i ].href.toLowerCase()
  64.  
  65.          if ( href.indexOf( "javascript:" ) != -1 ) break
  66.  
  67.          if ( href.indexOf( "mailto:" ) != -1 ) break
  68.  
  69.    
  70.  
  71.          // Verify nethelp: URL.
  72.  
  73.          if ( href.indexOf( "nethelp:" ) == -1 ) system.badURLerror( href )
  74.  
  75.       }
  76.  
  77.    }
  78.  
  79.  
  80.  
  81.    top.StatusFrame.setStatusClear()
  82.  
  83.  
  84.  
  85.    // Manage layered topics. We travel here even if the system is not using
  86.  
  87.    // layered topics.
  88.  
  89.    system.manageLayers()
  90.  
  91. }
  92.  
  93.  
  94.  
  95.  
  96.  
  97. function loadSheet(platform,location)
  98. {
  99.     //alert(platform,location);
  100.     if ((location) && (location == "top")) {
  101.     
  102.                 if ((platform == "Win32")) {
  103.         
  104.                     document.write("<LINK REL=STYLESHEET TYPE='text/css' HREF='/Netscape/shared/NetHelpw.css'>");
  105.                 
  106.                 }
  107.                 
  108.                 else if ((platform == "MacPPC") || (platform == "Mac68k")) {
  109.                 
  110.                     document.write("<LINK REL='STYLESHEET' TYPE='text/css' HREF='/Netscape/shared/NetHelpm.css'>");
  111.                 
  112.                 }
  113.                 
  114.                 else {
  115.                 
  116.                     document.write("<LINK REL='STYLESHEET' TYPE='text/css' HREF='/Netscape/shared/NetHelpu.css'>");
  117.                 
  118.                 }
  119.             
  120.     }
  121.  
  122.     if ((location) && (location == "content")) {
  123.     
  124.                 if ((platform == "Win32")) {
  125.         
  126.                     document.write("<LINK REL=STYLESHEET TYPE='text/css' HREF='../shared/NetHelpw.css'>");
  127.                 
  128.                 }
  129.                 
  130.                 else if ((platform == "MacPPC") || (platform == "Mac68k")) {
  131.                 
  132.                     document.write("<LINK REL='STYLESHEET' TYPE='text/css' HREF='../shared/NetHelpm.css'>");
  133.                 
  134.                 }
  135.                 
  136.                 else {
  137.                 
  138.                     document.write("<LINK REL='STYLESHEET' TYPE='text/css' HREF='../shared/NetHelpu.css'>");
  139.                 
  140.                 }
  141.             
  142.     }
  143. }
  144.  
  145.